package cc.marcio.systems.seven.dao;

import java.io.Serializable;

import org.hibernate.Session;

import cc.marcio.systems.seven.model.Round;


@SuppressWarnings("serial")
public class RoundDao extends BaseDaoImpl<Round> implements BaseDao<Round> {

	protected RoundDao(Session session) {
		super(session);
	}

	@Override
	public Round get(Serializable id) {
		Round round = super.get(id); 
		round.setupRound();
		super.update(round);
		return round;
	}

	@Override
	public Round load(Serializable id) {
		Round round = super.load(id); 
		round.setupRound();
		super.update(round);
		return round;
	}
	
	public Round current() {
		Round round = super.findOneByExample(new Round());
		round.setupRound();
		super.update(round);
		return round;
	}
}
